import clickAddNode from './createNode'

// behaviors配置
function behaviorsConfig(params) {
    const defaultBehaviors = ['zoom-canvas', 'drag-canvas', 'drag-element']
    const list = {
        createEdge: {
            type: 'create-edge',
            trigger: 'click',
            style: {
                stroke: 'red',
                lineWidth: 2,
            }
        },
        createNode: clickAddNode(params),
    }
    if (params.behaviors) {
        let otherBehaviors = params.behaviors.map(item => list[item])
        return params.behaviors ? [...defaultBehaviors, ...otherBehaviors] : defaultBehaviors
    }
    return params.behaviors ? [...defaultBehaviors, list[params.behaviors]] : defaultBehaviors
}

function pluginConfig(params) {

}

function contextmenuConfig(params) {

}

export {behaviorsConfig, pluginConfig}
